// pages/messageNotification/messageNotification.js
Page({
    data: {
      one:[],
      openid:""
    },
    onLoad(options) {
      this.setData({
        openid:getApp().globalData.openid
      })
      // 导航栏
      // 1.获取屏幕可使用宽度
      let windowWidth = wx.getSystemInfoSync().windowWidth;
      // 2.获取状态栏高度
      const statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
      //3.获取胶囊按钮位置信息
      const menuButton = wx.getMenuButtonBoundingClientRect();
      this.setData({
        navtop:menuButton.top
      })
      wx.request({
        url: 'https://dj.ifankui.com/api/usrEn/getMsg',
        method:'POST',
        data:{
          openid:this.data.openid
        },
        header: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        success:(res)=>{
          console.log(res);
          const newone = res.data.data.reverse()
          this.setData({
            one:newone.slice(0,10)
          })
        }
      })
    },
    gitfor(){
      wx.navigateBack({
        delta: -1
      })
    },
    xiangqing(e){
       console.log(e.currentTarget.dataset.id);
        wx.navigateTo({
          url: '/pages/Messagelist/Messagelist?id='+e.currentTarget.dataset.id,
        })
    }
  })